[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Has bignumber support changed since 1.4?
From: |
Crowder, Brian |
Subject: |
RE: Has bignumber support changed since 1.4? |
Date: |
Mon, 10 Sep 2001 14:46:14 -0700 |
In CFrontEndManager::TimeSlice() I do:
.......
GuileLoadFile("homeworld.scm"); // Just a wrapper to
scm_primitive_load
SCM code = SCM_VARIABLE_REF(scm_c_lookup("do-homeworld"));
SCM homeworld = Guile_CParamDBHomeWorld2SCM(info.m_pHomeWorld); //
Make homeworld SMOB
scm_call_1(code, homeworld); // Call "do-homeworld" from
homeworld.scm
In homeworld.scm:
(define (do-homeworld homeworld)
(begin
(pprint-homeworld homeworld)
(homeworld-set-population homeworld (+ (homeworld-get-population
homeworld) 65555))
(gc)))
And homeworld-set-population is a guile wrapper to the following:
SCM Guile_Set_CParamDBHomeWorld_population(SCM data, SCM value)
{
SCM_ASSERT(SCM_SMOB_PREDICATE(SCM_HOMEWORLD_TAG, data),
data, SCM_ARG1, "homeworld-set-population");
CParamDBHomeWorld *pData = (CParamDBHomeWorld *)SCM_SMOB_DATA(data);
pData->m_nPopulation = scm_num2int(value, SCM_ARG2,
"homeworld-set-population");
return SCM_BOOL_T;
}
The (gc) in the homeworld.scm code will cause a crash on Win32, with a
guile-1.5.1 I built... (admittedly, the build is probably a bit sketchy,
but I used the same technique on 1.4.1 and it worked okay --- configure
under Cygwin tools, and then plug resulting files into MSVC project).
Thanks!
Brian
-----Original Message-----
From: Dirk Herrmann [mailto:address@hidden
Sent: Monday, September 10, 2001 2:40 PM
To: Crowder, Brian
Cc: 'address@hidden'; 'address@hidden'
Subject: Re: Has bignumber support changed since 1.4?
On Mon, 10 Sep 2001, Crowder, Brian wrote:
>
> It seems to be somewhat broken in 1.5.1 on Windows 95/98/NT, now... and
it
> wasn't in 1.4. When I have an immediate value that increments higher than
> 65535 (should become a bignum?), I get a crash in garbage collection:
>
> free(void * 0x02b86fd8) line 956 + 11 bytes
> scm_must_free(void * 0x02b86fd8) line 2128 + 9 bytes
> scm_gc_sweep() line 1862 + 12 bytes
> scm_igc(const char * 0x008b9da0 `string') line 1155
> scm_gc() line 914 + 10 bytes
> scm_ceval(scm_unused_struct * 0x02ae30a0, scm_unused_struct * 0x02ae2de8)
> line 2686 + 8 bytes
> scm_apply(scm_unused_struct * 0x02ae2da8, scm_unused_struct * 0x00002974,
> scm_unused_struct * 0x02ae2de8) line 3605 + 221 bytes
> scm_call_1(scm_unused_struct * 0x02ae3048, scm_unused_struct * 0x02ae2e08)
> line 3269 + 19 bytes
> CFrontEndManager::TimeSlice() line 1503 + 16 bytes
> .
> .
> .
> .
>
> Any thoughts?
Could you post a code example, please?
Best regards
Dirk Herrmann