RWOps

Greetings.

I've noticed that there is no "SDL_FreeRW(SDL_RWops *)" to 

complement “SDL_RWops * SDL_AllocRW(void)”. I recently wrote my own
RWClose which the rwops structure gets told about during creation but
because i used SDL_AllocRW to creat the strucute I can’t free it using
my Free bucause my memory manager is different (ie: SDL owns the
memory). What SDL creats SDL should also Free, so how about adding
"SDL_FreeRW(SDL_RWops *)".

thanks.

-dv

Greetings.

I’ve noticed that there is no “SDL_FreeRW(SDL_RWops *)” to
complement “SDL_RWops * SDL_AllocRW(void)”. I recently wrote my own
RWClose which the rwops structure gets told about during creation but
because i used SDL_AllocRW to creat the strucute I can’t free it using
my Free bucause my memory manager is different (ie: SDL owns the
memory). What SDL creats SDL should also Free, so how about adding
"SDL_FreeRW(SDL_RWops *)".

You are absolutely right. This is in CVS, and will be in SDL 1.1.3

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This is one of the many problems caused by the fact that
all of the SDL libs are statically linked against
libcmt.lib, thereby each one carrying around private
copies of malloc, fopen, fread & friends.

But for some reason I can’t convince Sam to use msvcrt.dll…

MarkusOn 30-May-2000 Sam Lantinga wrote:

Greetings.

 I've noticed that there is no "SDL_FreeRW(SDL_RWops *)" to 

complement “SDL_RWops * SDL_AllocRW(void)”. I recently wrote my own
RWClose which the rwops structure gets told about during creation but
because i used SDL_AllocRW to creat the strucute I can’t free it using
my Free bucause my memory manager is different (ie: SDL owns the
memory). What SDL creats SDL should also Free, so how about adding
"SDL_FreeRW(SDL_RWops *)".

You are absolutely right. This is in CVS, and will be in SDL 1.1.3

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

---- Markus F.X.J. Oberhumer @ http://oberhumer.tsx.org ----
---- 5E CB 5C 85 DE AF 9E BF E9 DA 7E 6A 39 F8 CC 67 ----

                  3 WARPS TO URANUS

This is one of the many problems caused by the fact that
all of the SDL libs are statically linked against
libcmt.lib, thereby each one carrying around private
copies of malloc, fopen, fread & friends.

But for some reason I can’t convince Sam to use msvcrt.dll…

Apart from the fact that it’s a single platform, Microsoft-loving, sexually
assaulted, feeble-minded, made in Korea pile of constipated mouse droppings
the size of baseballs? :slight_smile:

Markus

Nicholas (not that I object to Korean products. Most of them take at least
five days to break or explode)

----- Original Message -----
From: markus.oberhumer@jk.uni-linz.ac.at (Markus F.X.J. Oberhumer)
To: sdl at lokigames.com
Date: Monday, May 29, 2000 9:08 PM
Subject: Re: [SDL] RWOps

Apart from the fact that it’s a single platform, Microsoft-loving, sexually
[…]

Please refrain from this kind of language on the list.

Thanks.

-Sam Lantinga, Lead Programmer, Loki Entertainment Software

This is one of the many problems caused by the fact that
all of the SDL libs are statically linked against
libcmt.lib, thereby each one carrying around private
copies of malloc, fopen, fread & friends.

But for some reason I can’t convince Sam to use msvcrt.dll…

Let me just try replying technically to this like I should have done instead
of being snarky and dashing off the first thing that comes to mind. (Sam,
get away from me with the big spiky clue stick… OW!)

IMO there are reasons why we shouldn’t use msvcrt.dll. As my previous post
"indicated" somewhere in that mess, msvcrt.dll is not cross-platform and
would lead to code duplication. SDL’s mission statement is that it is
cross-platform technology; ergo, a radical splice like that would cause no
end of havoc. You’d have two diverging code paths in an area where it isn’t
really necessary.

The basic principle of cross-platform design is, “If we don’t need to repeat
it, then let’s not.” In this case, most of the problems can be fixed. You
fixed one. More are being found and fixed. But there is no need to splice
functionality off if it already works. “If it ain’t broke, don’t fix it.”

This is my best guess as to Sam’s reasoning. If we can fix any problems that
we get as a result of working this way, let’s fix them. If not, splitting
the code is an option, but a highly undesireable one. Theoretically, the
closer we are to ANSI C compliancy the better. (I may be wrong, of
course…)

Markus

Nicholas (chastised, goes writes stuff to amend)

----- Original Message -----
From: markus.oberhumer@jk.uni-linz.ac.at (Markus F.X.J. Oberhumer)
To: sdl at lokigames.com
Date: Monday, May 29, 2000 9:08 PM
Subject: Re: [SDL] RWOps