Skip to content

Commit

Permalink
Merge branch 'master' of github.com:parrot/parrot
Browse files Browse the repository at this point in the history
  • Loading branch information
plobsing committed Dec 5, 2010
2 parents 5e4c203 + 1f1054f commit 9bec614
Show file tree
Hide file tree
Showing 31 changed files with 217 additions and 292 deletions.
2 changes: 0 additions & 2 deletions MANIFEST
Expand Up @@ -240,7 +240,6 @@ config/gen/platform/cygwin/math.c []
config/gen/platform/darwin/begin.c []
config/gen/platform/darwin/hires_timer.c []
config/gen/platform/darwin/sysmem.c []
config/gen/platform/freebsd/sysmem.c []
config/gen/platform/generic/dl.c []
config/gen/platform/generic/dl.h []
config/gen/platform/generic/env.c []
Expand All @@ -264,7 +263,6 @@ config/gen/platform/ia64/asm.s []
config/gen/platform/netbsd/math.c []
config/gen/platform/netbsd/misc.c []
config/gen/platform/netbsd/misc.h []
config/gen/platform/netbsd/sysmem.c []
config/gen/platform/openbsd/math.c []
config/gen/platform/openbsd/memexec.c []
config/gen/platform/openbsd/misc.h []
Expand Down
28 changes: 16 additions & 12 deletions README
Expand Up @@ -39,21 +39,21 @@ The method depends on your distribution. To install you should execute (as root

On Ubuntu/Debian (apt-based):

apt-get install git-core
apt-get install git-core

On Red Hat, Fedora (rpm-based):

yum install git
yum install git

on Gentoo (portage):

emerge -av dev-vcs/git
emerge -av dev-vcs/git

Windows:
There are 2 Git ports on Windows:

msysgit (http://code.google.com/p/msysgit/downloads/list)
TortoiseGit (http://code.google.com/p/tortoisegit/downloads/list)
msysgit http://code.google.com/p/msysgit/downloads/list
TortoiseGit http://code.google.com/p/tortoisegit/downloads/list

Macintosh OS X
An Internet search will locate a variety of git installers for Mac OS X,
Expand All @@ -63,17 +63,21 @@ including this:

II. Obtaining Parrot from github.com

In Git, branches represent some major changes of source.
You can view the list of branches at http://github.com/parrot/parrot
To fetch the source from the master branch:
To get a copy of the Parrot Git repository:

git clone git://github.com/parrot/parrot.git

git clone git://github.com/parrot/parrot.git
This will checkout the master branch by default. To create a local branch
that tracks the branch "some_branch":

To fetch the source from a branch:
git checkout -b --track some_branch origin/some_branch

git clone git://github.com/parrot/parrot.git -b <branch>, e.g:
All the above URLs are read-only. If you are a Parrot core developer, then
use the read-write URL:

git clone git://github.com/parrot/parrot.git -b gsoc_threads
git clone git@github.com:parrot/parrot.git

You can view the list of branches at http://github.com/parrot/parrot

INSTRUCTIONS
------------
Expand Down
2 changes: 1 addition & 1 deletion config/auto/headers.pm
Expand Up @@ -97,7 +97,7 @@ sub _list_extra_headers {
# the header.
my @extra_headers = qw(malloc.h fcntl.h setjmp.h pthread.h signal.h
sys/types.h sys/socket.h netinet/in.h arpa/inet.h
sys/stat.h sysexit.h limits.h);
sys/stat.h sysexit.h limits.h sys/sysctl.h);

# more extra_headers needed on mingw/msys; *BSD fails if they are present
if ( $conf->data->get('OSNAME_provisional') eq "msys" ) {
Expand Down
69 changes: 0 additions & 69 deletions config/gen/platform/freebsd/sysmem.c

This file was deleted.

56 changes: 53 additions & 3 deletions config/gen/platform/generic/sysmem.c
Expand Up @@ -20,11 +20,12 @@ Get system memory information.
*/

#include <stdio.h>
#include <unistd.h>
#include "parrot/sysmem.h"

#ifdef _SC_PAGESIZE /* some SVR4 systems omit an underscore */
# define _SC_PAGE_SIZE _SC_PAGESIZE
#if defined(PARROT_HAS_HEADER_SYSSYSCTL)
# include <sys/sysctl.h>
#endif

/*
Expand All @@ -37,10 +38,59 @@ Get information about available physical memory.
*/

/*
* The POSIX name is _SC_PAGESIZE, but apparently some systems
* require _SC_PAGE_SIZE instead. (Specific citations would
* be useful.)
*/
#if !defined(_SC_PAGESIZE) && defined(_SC_PAGE_SIZE)
# define _SC_PAGESIZE _SC_PAGE_SIZE
#endif

size_t
Parrot_sysmem_amount(PARROT_INTERP)
{
return sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGE_SIZE);
size_t memsize = 0;

#if defined(_SC_PAGESIZE) && defined(_SC_AVPHYS_PAGES)
/* Method 1: sysconf().
* Works on Linux and Solaris, and probably other SVR4-related systems.
* This should really check for #ifdef HAS_SYSCONF, but Configure
* doesn't probe for that yet.
*/
memsize = sysconf(_SC_AVPHYS_PAGES) * sysconf(_SC_PAGESIZE);

#elif defined(PARROT_HAS_HEADER_SYSSYSCTL) && defined(CTL_HW) && defined(HW_PHYSMEM)

/* Method 2: sysctl(). Works on BSD-derived systems. Darwin is
* slightly different, and has its own implementation.
* Configure really should test for HAS_SYSCTL, but, for now, test for
* the header sys/sysctl.h and the appropriate constants.
*/

int err = 0;
char *err_msg;
unsigned long length = sizeof (memsize);

int selection[2] = { CTL_HW, HW_PHYSMEM };

err = sysctl(selection, 2, &memsize, &length, NULL, 0);

if (err) {
err_msg = strerror(err);
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
"sysctl failed: %s", err_msg);
}

#else
/* Method 3: Random guess. Simply guess 512 MB. This way, parrot
* will at least build. Arguably, one could also just put an error
* here and instruct the user to fix it manually.
*/
memsize = 512 * 1024 * 1024;
#endif

return memsize;
}

/*
Expand Down
69 changes: 0 additions & 69 deletions config/gen/platform/netbsd/sysmem.c

This file was deleted.

2 changes: 1 addition & 1 deletion docs/embed.pod
Expand Up @@ -658,7 +658,7 @@ The list may also be augmented if additional functionality is required.

=item C<Parrot_freeze_at_destruct>

=item C<Parrot_full_sub_name>
=item C<Parrot_sub_full_sub_name>

=item C<parrot_gc_context>

Expand Down
9 changes: 9 additions & 0 deletions docs/project/git_workflow.pod
Expand Up @@ -112,6 +112,15 @@ that will be included in your next commit) :
The command C<git add> is not only for adding new files, just keep that in mind.
It tells git "add the state of these files to my staging area."

If you are trying to add files that are in .gitignore, you can do that with
the --force flag:

git add --force ports/foo

NOTE: Make sure these files should actually be added. Most files in .gitignore should
never be added, but some, such as some files in "ports/" will need need the --force
flag.

Now for actually creating your commit! Since Git is a distributed version control
system, committing code is seperate from sending your changes to a remote server.
Keep this in mind if you are used to Subversion or similar VCS's, where committing
Expand Down
7 changes: 5 additions & 2 deletions include/parrot/hll.h
Expand Up @@ -52,7 +52,9 @@ PMC* Parrot_hll_get_HLL_namespace(PARROT_INTERP, int hll_id)
__attribute__nonnull__(1);

PARROT_EXPORT
INTVAL Parrot_hll_get_HLL_type(PARROT_INTERP, INTVAL hll_id, INTVAL core_type)
INTVAL Parrot_hll_get_HLL_type(PARROT_INTERP,
INTVAL hll_id,
INTVAL core_type)
__attribute__nonnull__(1);

PARROT_EXPORT
Expand All @@ -74,7 +76,8 @@ void Parrot_hll_register_HLL_type(PARROT_INTERP,
void Parrot_hll_init_HLL(PARROT_INTERP)
__attribute__nonnull__(1);

#define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_namespace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_namespace \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_hll_get_ctx_HLL_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
Expand Down
2 changes: 1 addition & 1 deletion include/parrot/oplib/core_ops.h
Expand Up @@ -51,7 +51,7 @@ op_lib_t *Parrot_DynOp_core_2_10_1(PARROT_INTERP, long init);
opcode_t * Parrot_yield(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_tailcall_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_returncc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_capture_lex_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_sub_capture_lex_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_newclosure_p_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_set_args_pc(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_get_params_pc(opcode_t *, PARROT_INTERP);
Expand Down

0 comments on commit 9bec614

Please sign in to comment.