summaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-21 09:00:02 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-10-21 09:00:02 +0000
commit5b014a7427ef87fecb54c368cf3fe1efabb03f03 (patch)
treea2f8e5c4ef38a997e4cc3cc10ae136748b8890d9 /st.c
parent73f94bb851588f04e5189d37544e87884fc489c7 (diff)
* bin/erb (ERB::Main::run): typo fixed. [ruby-core:06337]
* env.h: move struct METHOD and struct BLOCK from eval.c to support NodeWrap and ParseTree. * rubysig.h (CHECK_INTS): prevent signal handler to run during critical section. [ruby-core:04039] * eval.c (load_wait): need not to call rb_thread_schedule() explicitly. [ruby-core:04039] * eval.c (rb_thread_schedule): clear rb_thread_critical. [ruby-core:04039] * eval.c (rb_obj_instance_exec): create instance_exec and module_exec which pass arguments to the block. * eval.c (rb_f_funcall): rename fcall to funcall to follow tradition. * st.c (st_free_table): do not call free() but xfree(). [ruby-core:06205] * eval.c (splat_value): call rb_Array() to convert svalue to values. [ruby-dev:27397] * lib/cgi.rb (CGI::Cookie::parse): Cookies from Nokia devices may not be parsed correctly. A patch from August Z. Flatby (augustzf) in [ruby-Patches-2595]. [ruby-core:06183] * object.c (rb_Array): Array() to raise error for objects without to_ary, nor to_a. * object.c (nil_to_a): revert NilClass#to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'st.c')
-rw-r--r--st.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/st.c b/st.c
index 812b57f..5aa202f 100644
--- a/st.c
+++ b/st.c
@@ -4,12 +4,10 @@
#include "config.h"
#include <stdio.h>
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#include <string.h>
-
-#ifdef _WIN32
-#include <malloc.h>
#endif
+#include <string.h>
#ifdef NOT_RUBY
#include "regint.h"
@@ -216,12 +214,12 @@ st_free_table(st_table *table)
ptr = table->bins[i];
while (ptr != 0) {
next = ptr->next;
- free(ptr);
+ xfree(ptr);
ptr = next;
}
}
- free(table->bins);
- free(table);
+ xfree(table->bins);
+ xfree(table);
}
#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \
@@ -330,7 +328,7 @@ rehash(register st_table *table)
ptr = next;
}
}
- free(table->bins);
+ xfree(table->bins);
table->num_bins = new_num_bins;
table->bins = new_bins;
}
@@ -352,7 +350,7 @@ st_copy(st_table *old_table)
Calloc((unsigned)num_bins, sizeof(st_table_entry*));
if (new_table->bins == 0) {
- free(new_table);
+ xfree(new_table);
return 0;
}
@@ -362,8 +360,8 @@ st_copy(st_table *old_table)
while (ptr != 0) {
entry = alloc(st_table_entry);
if (entry == 0) {
- free(new_table->bins);
- free(new_table);
+ xfree(new_table->bins);
+ xfree(new_table);
return 0;
}
*entry = *ptr;
@@ -395,7 +393,7 @@ st_delete(register st_table *table, register st_data_t *key, st_data_t *value)
table->num_entries--;
if (value != 0) *value = ptr->record;
*key = ptr->key;
- free(ptr);
+ xfree(ptr);
return 1;
}
@@ -406,7 +404,7 @@ st_delete(register st_table *table, register st_data_t *key, st_data_t *value)
table->num_entries--;
if (value != 0) *value = tmp->record;
*key = tmp->key;
- free(tmp);
+ xfree(tmp);
return 1;
}
}
@@ -496,7 +494,7 @@ st_foreach(st_table *table, int (*func)(ANYARGS), st_data_t arg)
last->next = ptr->next;
}
ptr = ptr->next;
- free(tmp);
+ xfree(tmp);
table->num_entries--;
}
}