aboutsummaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-06-01 17:47:56 +0000
committerSimon Tatham <anakin@pobox.com>2005-06-01 17:47:56 +0000
commit50edaa578b614eb74c57a38faa2d05ab628ff81b (patch)
treea48afa49172e113d2f867f33bb8f1c216b4bda8f /malloc.c
parentad3abd9867962c94feeb09956e53c6fde886df0e (diff)
downloadpuzzles-50edaa578b614eb74c57a38faa2d05ab628ff81b.zip
puzzles-50edaa578b614eb74c57a38faa2d05ab628ff81b.tar.gz
puzzles-50edaa578b614eb74c57a38faa2d05ab628ff81b.tar.bz2
puzzles-50edaa578b614eb74c57a38faa2d05ab628ff81b.tar.xz
Miscellaneous fixes from James Harvey's PalmOS porting work:
- fixed numerous memory leaks (not Palm-specific) - corrected a couple of 32-bit-int assumptions (vital for Palm but generally a good thing anyway) - lifted a few function pointer types into explicit typedefs (neutral for me but convenient for the source-munging Perl scripts he uses to deal with Palm code segment rules) - lifted a few function-level static arrays into global static arrays (neutral for me but apparently works round a Palm tools bug) - a couple more presets in Rectangles (so that Palm, or any other slow platform which can't handle the larger sizes easily, can still have some variety available) - in Solo, arranged a means of sharing scratch space between calls to nsolve to prevent a lot of redundant malloc/frees (gives a 10% speed increase even on existing platforms) [originally from svn r5897]
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc.c b/malloc.c
index fd0ddf9..a7fa7c5 100644
--- a/malloc.c
+++ b/malloc.c
@@ -10,7 +10,7 @@
* smalloc should guarantee to return a useful pointer - Halibut
* can do nothing except die when it's out of memory anyway.
*/
-void *smalloc(int size) {
+void *smalloc(size_t size) {
void *p;
p = malloc(size);
if (!p)
@@ -30,7 +30,7 @@ void sfree(void *p) {
/*
* srealloc should guaranteeably be able to realloc NULL
*/
-void *srealloc(void *p, int size) {
+void *srealloc(void *p, size_t size) {
void *q;
if (p) {
q = realloc(p, size);