aboutsummaryrefslogtreecommitdiff
path: root/src/bi_db.m4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-03-31 20:31:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-03-31 20:31:40 +0000
commit86be9fa5494be9417f90f16f87eca6ab2a28631d (patch)
treea3bd15dc99defd2413d1a0af10e946c6b6d0c01b /src/bi_db.m4
parent5633a8204a428a28582225810f215b23445037d5 (diff)
downloadmailfromd-86be9fa5494be9417f90f16f87eca6ab2a28631d.tar.gz
mailfromd-86be9fa5494be9417f90f16f87eca6ab2a28631d.tar.bz2
Switch to flat address space model. Data space (and stack) contain
only references to objects within the data space (virtual addresses), no actual pointers are passed. * src/snarf.m4 (MF_ALLOC_HEAP, MF_COPY_STRING): Take two arguments (MF_BEGIN_TEMP_SPACE): Use env_data_ref (MF_VAR_SET_STRING): New macro * src/bi_poll.m4, src/bi_string.m4, src/bi_dns.m4, src/bi_spf.m4, src/bi_sa.m4, src/bi_vars.m4, src/bi_db.m4: Use new heap allocation macros. * src/drivers.c (code_memref, code_type_string): Use opcode_push (code_type_variable): Remove opcode_svalidate. This time for good * src/mailfromd.h (env_throw_0): Change signature * src/prog.c (struct eval_environ.stack): Remove. Use plain addressing model. All references updated. (env_reference,env_var_ref): Remove (heap_reserve_words, heap_reserve): Return offset into the data space instead of the pointer. All uses updated. (env_data_ref): New function * src/opcodes (MEMEXT,MEM,SVALIDATE): Remove * src/prog.h (env_data_ref): New function (heap_reserve_words): New function (heap_reserve): Return size_t * TODO: Update git-svn-id: file:///svnroot/mailfromd/trunk@1331 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'src/bi_db.m4')
-rw-r--r--src/bi_db.m45
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bi_db.m4 b/src/bi_db.m4
index 816ecc58..fecc0eb8 100644
--- a/src/bi_db.m4
+++ b/src/bi_db.m4
@@ -53,11 +53,12 @@ dbmap_lookup(eval_environ_t env, char *dbname, const char *keystr,
else
push(env, 0);
} else if (((char*)MU_DATUM_PTR(contents))[MU_DATUM_SIZE(contents)-1]) {
+ size_t off;
size_t len = MU_DATUM_SIZE(contents);
- char *s = MF_ALLOC_HEAP(len + 1);
+ char *s = MF_ALLOC_HEAP(off, len + 1);
memcpy(s, MU_DATUM_PTR(contents), len);
s[len] = 0;
- push(env, (STKVAL) s);
+ push(env, (STKVAL) off);
} else
pushs(env, MU_DATUM_PTR(contents));
}

Return to:

Send suggestions and report system problems to the System administrator.