Commit Graph

176 Commits

Author SHA1 Message Date
Matthew Flatt
89307edbce ffi/unsafe/com: avoid inclusion of no-error result code in error messages
Merge to 5.3
2012-04-11 17:55:12 -06:00
Matthew Flatt
bcb22a3adb ffi/unsafe/com: repair for optional `any' arguments
Merge to 5.3
2012-04-11 17:49:08 -06:00
Matthew Flatt
e62f812941 ffi/com: fix another GC problem, this time related to custodians 2012-04-04 07:16:50 -06:00
Matthew Flatt
522a92970e ffi/com: fix GC issue related to COM events 2012-04-04 07:00:25 -06:00
Matthew Flatt
89ef600b6e ffi/unsafe/com: com-object->eq?' implies equal?' 2012-04-03 18:36:27 -06:00
Matthew Flatt
cb7200295e ffi/unsafe/com: fix custodian and multi-instance problems 2012-04-02 14:36:23 -06:00
Matthew Flatt
2bf05a8df3 ffi/unsafe/com repairs 2012-04-01 12:58:16 -06:00
Matthew Flatt
738cac3d24 generalize `malloc' to allow a 0-sized request
Past experience suggests that this is generally better than adding
`zero?' tests at various places that might otherwise call `malloc'.
2012-03-29 14:55:14 -06:00
Siddharth Agarwal
a73b9bb788 ffi: extend _list and _vector to support zero-length output 2012-03-29 14:55:14 -06:00
Eli Barzilay
592d23f5b5 Minor improvement: use `make-rename-transformer' instead of a macro. 2012-03-25 20:57:53 -04:00
Matthew Flatt
a884c91720 ffi/unsafe: add `array-length'
Closes PR 12576
2012-02-20 08:09:06 -07:00
Matthew Flatt
11de33d4ff remove MysterX DLL, replace with wrapper around `ffi/com'
The ActiveX part of MysterX is gone. The `ffi/com' re-imeplemtnation
provides only core COM support.

The "mysssink" DLL is still needed, and its source is still
in the tree, but it is downloaded in the same way as other
pre-built DLLs. The DLL no longer needs to be registered with
regsvr32.
2012-02-17 06:37:19 -07:00
Matthew Flatt
b93eaa19f4 ffi/unsafe/alloc: releaser should be able to return a value 2012-02-17 06:36:23 -07:00
Matthew Flatt
f461d9f67d ffi: fix _x-pointer/null' when _x' has a supertype
This is more specifically a bug in `_cpointer/null', but it
shows up most easily through C structs.
2012-02-17 06:36:23 -07:00
Matthew Flatt
084278fabc handle-evt' cannot wrap handle-evt'
The prohbition against `handle-evt' on `handle-evt' is as
document and as originally intended. I'm not sure why it
was allowed.

Existing programs that use `handle-evt' incorrectly
can break. I found and fixed one incorrect use and one
questionable use in the Racket tree (which is a small
minority of the uses of `handle-evt' in the tree).
2012-02-15 18:59:24 -07:00
Matthew Flatt
6cd2e3c71b add `prop:cpointer'
Extend `define-cstruct' to support #:property specs, which causes
the constructor and C->Racket coercsions to wrap the pointer in
a structure instance with the specified properties. Of course,
the wrapper structure has a `prop:cpointer' property so that the
wrapper can be used transparently as a C pointer.

Add missing tests and documentation for the id`->list', `list->'id,
id`->list*', and `list*->'id bindings created by `define-cstruct'.
2012-02-14 14:25:55 -07:00
Matthew Flatt
13a5b0c623 change `ffi-lib' to not make library symbols global by default 2012-01-26 09:30:25 -05:00
Matthew Flatt
ff41a896bc add ffi/com', ffi/unsafe/com' 2012-01-10 18:35:32 -07:00
Matthew Flatt
745c4b6470 fix another way that `racket/gui' instances can leak 2011-12-02 15:48:29 -07:00
Matthew Flatt
be89a1c1c4 ffi/unsafe/objc: at least load on platforms without libobjc 2011-11-28 13:51:25 -07:00
Jon Rafkind
8ba0551fe5 add version 3 of libmagickwand to the ffi example 2011-11-18 09:59:43 -07:00
Matthew Flatt
75dd61ebc3 fix leak in `racket/draw' instantiation 2011-11-11 16:32:16 -07:00
Matthew Flatt
8bd81f4806 fix ffi retain of callbacks
The FFI's weak table of callback procedures (to map Racket procedures
to FFI callback objects) suffered from the classic key-in-value
problem.

Closes PR 12228, probably

Merge to 5.2
2011-10-09 09:01:15 -06:00
Matthew Flatt
f38e57ff68 add #:get-lib-dirs and #:fail args to `ffi-lib'
Not currently used, because an experiment that used the additions
was abandoned, but another use in the future seems likely.
2011-10-05 06:28:30 -06:00
Matthew Flatt
0197902309 add var-ref->mod-decl-insp' and switch cur-code-insp' uses
Macros and other tools that need syntax privilege used
`(current-code-inspector)' at the module top-level to try to
capture the right code inspector at load time. It's more
consistent to instead use the enclosing module's declaration-time
inspector, and `var-ref->mod-decl-insp' provides that. The
new function works only on references to anonymous variables,
which limits access to the inspector.

The real function name is longer, of course.
2011-09-20 13:50:36 -06:00
Matthew Flatt
231b352bec fix NSProcessInfo arguments hack
The target of the change is actually `hack-argument-replacement' in
`mred/private/coco/queue'. The replaced method can get called in
a different OS-level thread than the main thread.

Closes PR 12086
2011-09-09 22:27:34 -06:00
Eli Barzilay
57ea31cca2 With 4f83f7f, the hack around PR7104 is no longer needed. 2011-08-29 16:36:24 -04:00
Kevin Tew
a810b30b87 remove underscore from cpointer key 2011-08-29 08:44:32 -06:00
Kevin Tew
fa4bb9dda0 Change cpointer tag to be a symbol 2011-08-23 13:33:06 -06:00
Matthew Flatt
345b06838d FFI: add C arrays and unions 2011-08-20 10:24:32 -06:00
Eli Barzilay
3157955d40 ".ss" -> ".rkt" scan done. 2011-07-02 10:37:53 -04:00
Matthew Flatt
59731368fc add ffi/winapi; use it in mzlib/os
Closes PR 12007
2011-07-01 10:42:17 -06:00
Robby Findler
69b5daa9e6 remove docs tests that no one was interested in 2011-07-01 11:38:09 +08:00
Matthew Flatt
1160d3df62 remove syntax certificates; add syntax taints 2011-06-29 19:15:48 -06:00
Eli Barzilay
40124a0619 A long overdue scan to eliminate files without terminating newlines.
(DrRacket should really do that.)
2011-06-28 02:01:41 -04:00
Matthew Flatt
49aadc599a ffi: add `#:in-original-place?' to deal with thread-unsafe libs
and use it for Pango, which is not thread-safe at the C level
2011-05-13 08:55:04 -06:00
Robby Findler
507b1cd8fd moved the docs-complete library into rackunit
to avoid having a separate, new manual for the
  one library
2011-05-05 16:10:42 -05:00
Matthew Flatt
3bf438f580 rewrite `ffi-lib' docs with better guidance on versions 2011-05-03 13:16:21 -06:00
Matthew Flatt
2ada6d0e89 break link to namespaces from from closures over top-/module-level vars
- the `lam' structure from `compiler/zo-struct' changed to include a
   `toplevel-map' field

 This change helps solve a finalization problem in `racket/draw',
 which in turn sigificantly reduces the peak memory use of `raco setup'
 during the doc-building phase (because some documents load `racket/draw'
 to render images, and multiple copies of `racket/draw' were retained
 before finalization was fixed).

 The change is an extreme way to solve a specific finalization
 problem, but it's a kind of space-safety improvement; space safety
 almost never matters, but when it does, then working around a lack of
 space safety is practically impossible. In this case, it's not clear
 how to otherwise solve the `racket/draw' finalization problem.

 The improvement doesn't change the representation of closures, but it
 requires special cooperation with the GC. All closures in a module
 continue to share the same array of globals (plus syntax objects);
 that is, instead of completely flat closures, Racket uses a two-level
 environment where top-/module-level variables are grouped
 together. The code half of a closure now records which
 top-/module-level variables the body code actually uses, and the mark
 phase of GC consults this information to retain only parts of the
 top-/module-level environment frame that are actually used by some
 closure (or all of the frame if it is accessible through some other
 route).  In other words, the GC supports a kind of "dependent
 reference" to an array that is indexed by positions into the array
 --- except that the code is more in the "Racket" directory instead of
 the "GC" directory, since it's so specific to the closure
 representation.
2011-05-03 06:57:49 -06:00
Robby Findler
e7d0029aea added lots of new tests that our documentation is complete 2011-04-25 13:24:43 -05:00
Jon Rafkind
3f572809c9 better error message when pre: or post: is used incorrectly 2011-04-18 17:27:21 -06:00
Ryan Culpepper
9bc3457bbd renamed ffi/unsafe/security to ffi/file 2011-04-15 14:47:29 -06:00
Ryan Culpepper
a19a0340aa added ffi/unsafe/security 2011-04-07 09:47:20 -06:00
David Van Horn
760a58b65d Fixes more spelling errors. 2011-02-04 19:44:13 -07:00
Matthew Flatt
cbea645284 fix try-atomic bug related to cont-mark-set-first and recent prompt fix 2011-01-20 07:10:05 -07:00
Matthew Flatt
4d008e3021 fix for pre-v2.0 Objective-C 2010-12-27 16:12:36 -07:00
Matthew Flatt
4a6af2a81e another try-atomic repair 2010-12-22 19:09:21 -07:00
Matthew Flatt
78b2e47541 fix more try-atomic problems 2010-12-21 18:45:36 -07:00
Matthew Flatt
1a190c08f6 remove debugging log message 2010-12-14 14:53:00 -07:00
Matthew Flatt
ea789fc481 further avoid nested try-atomics
to avoid the possibility of deadlock when, for example,
  `yield' is called during a try-atomic callback
2010-12-14 11:49:23 -07:00
Matthew Flatt
1d0adfd8f2 fix problem with nested try-atomic regions 2010-12-14 11:49:23 -07:00
Matthew Flatt
3479f5fb92 cocoa: hack around NSApplication's handling of command-line arguments 2010-12-02 11:53:18 -07:00
Matthew Flatt
ca8b32725e fix bloking operations during a try-atomic
and remove old delim-cont support used by gr1
2010-11-30 15:08:16 -07:00
Matthew Flatt
0d6d285423 clear objc ivar on `dealloc'
so that a field is not incorrectly used if the super `dealloc' triggers
 callbacks
2010-11-24 07:08:54 -07:00
Eli Barzilay
b8bbed6eb4 Throw an error when translating an unknown enum integer to a symbol.
Also, add a keyword argument that can be used to get the old behavior
back.

Also, improve the way the `_enum' and `_bitmask' functions are wrapped.
2010-11-16 15:19:38 -05:00
Eli Barzilay
4f36ce9635 Redo `define-cstruct' with proper errors and more concisely. 2010-11-12 17:21:11 -05:00
Jon Rafkind
de16fb118e improve define-cstruct error messages. closes pr11422 2010-11-11 13:27:49 -07:00
Eli Barzilay
735c4deac7 Throw a proper syntax error on uses of the ffi `->'.
Closes PR 11421
2010-11-11 13:39:49 -05:00
Matthew Flatt
af6cad4913 destroy windows via finalization outside of the event loop 2010-11-05 15:54:52 -06:00
Matthew Flatt
58e1e37734 fix bug in ffi struct alignment 2010-11-05 15:54:51 -06:00
Matthew Flatt
20ab31743d fix yet another mistake in atomic-mode implementation 2010-11-05 15:54:47 -06:00
Matthew Flatt
d2275f4179 level-2 finalization from ffi/unsafe and late-weak references 2010-11-05 15:54:47 -06:00
Matthew Flatt
40a65a46d2 overhaul GC finalization 2010-11-05 15:54:47 -06:00
Matthew Flatt
3294d3427a fix nested atomic escape 2010-11-05 15:54:46 -06:00
Matthew Flatt
2cebc60eca ppc cocoa 2010-11-05 15:54:45 -06:00
Matthew Flatt
391cbe1315 more pre-2.0 objc fixes 2010-11-05 15:54:45 -06:00
Matthew Flatt
8c5db384d4 more obj-c pre-2.0 fixes 2010-11-05 15:54:45 -06:00
Matthew Flatt
789563f82b support pre-2.0 Objective-C 2010-11-05 15:54:45 -06:00
Matthew Flatt
10455daf54 allowed nested try-atomics 2010-11-05 15:54:27 -06:00
Matthew Flatt
e9e180847a enforce modality; more on-subwindow- callbacks; Cocoa font tweaks 2010-11-05 15:54:11 -06:00
Matthew Flatt
6e23fcda5f fix _short' and other non-_int' integer types, and add `_intptr' test 2010-10-13 08:50:47 -06:00
Eli Barzilay
615d8f1329 Add _intptr etc; closes PR11311. 2010-10-12 20:58:08 -04:00
Matthew Flatt
d6684dad8c fix cstruct alignment handling 2010-10-01 10:49:40 -06:00
John Clements
e29c14c260 updates to sndfile 2010-09-28 08:12:25 -07:00
Matthew Flatt
337ace3847 add u8vector->cpointer for consistency; document ->cpointer, etc. 2010-09-27 06:08:58 -04:00
Matthew Flatt
c1aa594657 add fvectors and unsafe-{s,u}16-{ref,set!} 2010-09-24 16:32:07 -06:00
Matthew Flatt
17cdb9eb3b move #:alignment option for `define-cstruct' to end
to make it consistent with options for `struct' and `define-struct'
2010-09-10 08:06:41 -06:00
Matthew Flatt
5a833ffc57 fix optional argument of _list-cstruct 2010-09-10 07:55:58 -06:00
Matthew Flatt
6ac15688b2 add alignment option to ffi's cstruct support 2010-09-10 06:59:52 -06:00
John Clements
93ee20e290 mods to sndfile.rkt 2010-09-08 16:55:48 -07:00
Matthew Flatt
82f102bfd8 fix bug in objc-mixin #:protocols 2010-09-03 15:44:34 -06:00
John Clements
81a8bd3b28 updated to remove dependency on rackunit 2010-08-31 14:33:16 -07:00
John Clements
c824241a6e updates to sndfile.rkt & use-snd-file.rkt. Added an interface that doesn't
eagerly transform data into lists.  It's also very restrictive (assumes
float & 2-channel).
2010-08-31 11:42:19 -07:00
John Clements
6e31d8f2d7 editing sndfile support 2010-08-31 09:34:26 -07:00
John Clements
fbd4659260 updated sndfile for racket & for newer version of sndfile & other similar stuff. 2010-08-27 16:42:33 -07:00
Eli Barzilay
606b7f60dc Lots of "~e" to "~.s" changes. 2010-08-25 17:17:01 -04:00
Matthew Flatt
9c0c42f24a fix ffi/unsafe/try-atomic interaction with exns and prompt tags 2010-08-15 11:02:30 -06:00
Matthew Flatt
6c8a914c80 support for speculatively atomic calls in ffi/unsafe/try-atomic 2010-08-07 20:49:23 -05:00
Matthew Flatt
8df33b629e fix default #:keep argument of _cprocedure 2010-08-07 20:40:42 -05:00
Matthew Flatt
4d1e97ec8d change start-atomic and end-atomic to disable breaks 2010-08-07 20:40:32 -05:00
Matthew Flatt
95dd131e93 use msg-send table atomically 2010-07-13 16:07:02 -06:00
Matthew Flatt
768a3721f9 add async-apply support to FFI 2010-07-11 14:59:40 -06:00
Matthew Flatt
9597810a99 fix objc ABI for 64-bit Darwin 2010-06-11 15:18:00 -04:00
Matthew Flatt
f85b25f59f fix another typo like the one in dynext
Merge to v5.0
2010-05-26 17:07:08 -06:00
Matthew Flatt
28b4043077 rename all files .ss -> .rkt 2010-04-27 16:50:15 -06:00
Matthew Flatt
b7c184632b racket/unsafe/ffi -> ffi/unsafe, etc. 2010-04-26 18:05:29 -06:00
Matthew Flatt
4acba84b5b reorganize and extend FFI under racket/unsafe/ffi 2010-04-26 17:10:55 -06:00
Matthew Flatt
6f0d6b28de some mz and ffi changes from the mr2 branch
svn: r18099
2010-02-16 17:55:28 +00:00
Eli Barzilay
c88a5a6856 A bunch of additional typos
svn: r17976
2010-02-05 03:21:52 +00:00
John Clements
d75740f2e9 I can't help fixing grammatical errors, sorry
svn: r16313
2009-10-13 20:55:19 +00:00